﻿using DXApplicationTangche.service;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DXApplicationTangche.UC.客户管理
{
    public partial class Form会员积分 : DevExpress.XtraEditors.XtraForm
    {
        public Form会员积分()
        {
            InitializeComponent();
            this.刷新();
        }

        private void simpleButton刷新_Click(object sender, EventArgs e)
        {
            this.刷新();
        }
        private void 刷新()
        {
            List<PersonaDTO> personaDTOs = new List<PersonaDTO>();
            personaDTOs = CustomerService.getPersonaDao();
            this.gridControl会员积分.DataSource = personaDTOs;
            this.gridView会员积分.RefreshData();
        }

        private void simpleButton导出excel_Click(object sender, EventArgs e)
        {
            SaveFileDialog fileDialog = new SaveFileDialog();
            fileDialog.Title = "导出出入库明细";
            fileDialog.Filter = "Excel文件(*.xls)|*.xls";
            DialogResult dialogResult = fileDialog.ShowDialog(this);
            if (dialogResult == DialogResult.OK)
            {
                DevExpress.XtraPrinting.XlsExportOptions options = new DevExpress.XtraPrinting.XlsExportOptions();
                this.gridControl会员积分.ExportToXls(fileDialog.FileName);
                DevExpress.XtraEditors.XtraMessageBox.Show("保存成功！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
    }
}
